/*
 * Copyright (C) 2011 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.videoeditor.service;

import android.graphics.Bitmap;
import android.media.videoeditor.MediaItem;

import java.util.List;

/**
 * Interface for API service listener. This interface declares various callbacks that
 * clients might be interested in to handle responses or state change from various API
 * service actions. Clients should extend this interface and override interested callbacks.
 */
public class ApiServiceListener {
    /**
     * A new project was created
     *
     * @param projectPath The project path
     * @param mediaItems The list of media items
     * @param exception The exception that occurred
     */
    public void onVideoEditorCreated(String projectPath, List<MediaItem> mediaItems, 
			Exception exception) {}

    /**
     * The aspect ratio was set
     *
     * @param projectPath The project path
     * @param aspectRatio The aspect ratio
     * @param exception The exception that occurred
     */
    public void onVideoEditorAspectRatioSet(String projectPath, int aspectRatio, Exception exception) {}

    /**
     * Export progress status
     *
     * @param projectPath The project path
     * @param filename The name of the file to export
     * @param progress The export progress (0, 100)
     */
    public void onVideoEditorExportProgress(String projectPath, String filename, 
			int progress) {}

    /**
     * Export completed callback
     *
     * @param projectPath The project path
     * @param filename The name of the file to export
     * @param exception null if no exception has occurred (export succeeded)
     * @param cancelled if the export is cancelled by the user
     */
    public void onVideoEditorExportComplete(String projectPath, String filename,
            Exception exception, boolean cancelled) {}

    /**
     * Export canceled callback
     *
     * @param projectPath The project path
     * @param filename The name of the file to export
     */
    public void onVideoEditorExportCanceled(String projectPath, String filename) {}

    /**
     * The VideoEditor stated was deleted.
     *
     * @param projectPath The project path
     * @param exception The exception which occurred (if any)
     */
    public void onVideoEditorDeleted(String projectPath, Exception exception) {}

    /**
     * A media item thumbnail was extracted
     *
     * @param projectPath The project path
     * @param mediaItemId The id of the media item
     * @param thumbnail The bitmap thumbnail
     * @param index The index of the thumbnail
     * @param token The token given in the original request
     * @param exception The exception which occurred
     *
     * @return true if the bitmap is used
     */
    public boolean onMediaItemThumbnail(String projectPath, String mediaItemId,
            Bitmap thumbnail, int index, int token, Exception exception) {
        return false;
    }
}
